package com.chen.apidriver.service;

import com.chen.apidriver.remote.ServiceDriverUserClient;
import com.chen.internalcommon.dto.DriverUser;
import com.chen.internalcommon.dto.DriverUserWorkStatus;
import com.chen.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author chenLiuPing
 **/
@Service
public class UserService {

    @Autowired
    private ServiceDriverUserClient serviceDriverUserClient;

    public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser) {
        return serviceDriverUserClient.updateDriverUser(driverUser);
    }

    public ResponseResult changeWorkStatus(Long driverId, Integer workStatus) {
        DriverUserWorkStatus driverUserWorkStatus = new DriverUserWorkStatus();
        driverUserWorkStatus.setDriverId(driverId);
        driverUserWorkStatus.setWorkStatus(workStatus);
        return serviceDriverUserClient.changeWorkStatus(driverUserWorkStatus);

    }
}
